<template>
  <div class="save-button">
    <div class="buttons">
      <pro-authority v-for="(item, index) in buttons" :key="index" :value="item.code ? item.code : false">
        <a-button class="ml-10" :type="item.type ? item.type : 'default'" @click="item.event()">{{
            t(`button.${item.name}`)
          }}</a-button>
      </pro-authority>
    </div>
  </div>
</template>

<script>
import "./index.less";
import { defineComponent, computed } from "vue";

import { useI18n } from "vue-i18n";
export default defineComponent({
  name: 'footer-button',
  props: {
    buttons: {
      type: Array,
      default: () => []
    }
  },
  setup(props) {
    const { t } = useI18n();
    const button = computed(() => {
			return props.buttons;
		});

    return {
      button,
      t
    }
  }
})
</script>
